package com.pro.dao;

import com.pro.entity.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;

import java.util.List;
public interface ProductMapper {
    //查询商品
    List<Product> queryProduct(Product product);
    //查询商品分类
    List<ProductCategroy> productClass();
    //修改上架下架
    Boolean updateState(@Param("state") Integer state, @Param("id")Integer id);
    //修改商品
    Boolean updateProduct(Product product);
    //添加商品修改时的价格记录
    Boolean addProductJournal(NavigationBarData navigationBarData);
    //添加商品
    Boolean addProduct(Product product);
    //添加商品审核记录
    Boolean addProductCourse(CourseRecord courseRecord);
    //删除商品
    Boolean delProduct(Integer id);
    //删除商品分类
    Boolean delProductCaegory(Integer categoryId);
    //修改商品分类
    Boolean updateProductCaegory(@Param("categoryId")Integer categoryId,@Param("title")String title);
    //添加商品分类
    Boolean addProductCaegory(ProductCategroy productCategroy);
    //查询商品日志
    List<NavigationBarData> getNavIgation(NavigationBarData navigationBarData);
    //查询商品审核详情
    List<CourseRecordPlus> queryCourseRecord(Integer id);
    //添加商品操作日志
    Boolean addProductOperationRecord(JsLog jsLog);
    //查询商品收藏量
    @Select("select count(collection_id) from js_user_collection where collection_type = #{collectionType} and product_id = #{productId}")
    Integer getCollection(@Param("collectionType") Integer collectionType,@Param("productId") Integer productId);
    //查询商品销量
    @Select("select count(order_id) from js_user_order where shop_id = #{shopId} and order_status = #{orderStatus} and order_type = #{orderType}")
    Integer getSalesVolume(@Param("shopId") Integer shopId, @Param("orderStatus") Integer orderStatus, @Param("orderType") Integer orderType);
}
